package practice.w902;

import java.util.Random;

public class MaxMin {
    public static void main(String[] args) {
        Random rand = new Random();
        int[] a=new int[10];
        for (int i = 0; i <10 ; i++) {
            a[i]=rand.nextInt(100);
            System.out.println(a[i]);
        }
        int max=a[0];
        int min=a[0];
        for (int i = 1; i < a.length; i++) {
            if (a[i]>max) max=a[i];
            if (a[i]<min) min=a[i];
        }
        System.out.println("最大值是："+max+"最小值是"+min);
    }
}
